package com.asiainfo.sc.demo.gateway;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Configuration
@EnableAutoConfiguration
@EnableDiscoveryClient
@RestController
@EnableZuulProxy
public class ScZuul {
    private static final Logger logger = LoggerFactory.getLogger(ScZuul.class);

    @RequestMapping("/test")
    public String home() {
        logger.info("Hello World,here is  a sc-demo zuul");
        logger.trace("trace 成功了");
        logger.debug("debug 成功了");
        logger.info("info 成功了");
        logger.warn("warn 成功了");
        logger.error("error 成功了");
        return "Hello World,here is  a sc-demo zuul";
    }
    public static void main(String[] args) {
        SpringApplication.run(ScZuul.class, args);

    }

//    @Bean
//    public ScZuulFilter scZuulFilter(){
//        logger.info("注册filter:　{}" ,"ScZuulFilter");
//        return new ScZuulFilter();
//    }
}


